package ve.ejb.entity;

import ve.ejb.metadata.Settings;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

/**
 *
 * @author memozac
 */
@Entity
public class Map extends ScoreCard implements Serializable {
    private static final long serialVersionUID = 1L;

    @ManyToMany(targetEntity=Settings.class) @JoinTable(name="MapSettings", joinColumns=@JoinColumn(name="idMap"),
    inverseJoinColumns=@JoinColumn(name="idSettings")) private Collection<Settings> settings;

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idScoreCard != null ? idScoreCard.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Map)) {
            return false;
        }
        Map other = (Map) object;
        if ((this.idScoreCard == null && other.idScoreCard != null) || (this.idScoreCard != null && !this.idScoreCard.equals(other.idScoreCard))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.Map[id=" + idScoreCard + "]";
    }

}//ends of class
